<?php

namespace app\validate;

use think\Validate;

class OrderValidate extends Validate
{
    protected $rule = [
        'name|名字'       =>  'require|max:50',
        'key|key'       =>  'require',
        'second_name|第二名字'     => 'require|max:50',
        'id_card|身份证'     => 'require|max:50',
        'birthday|生日'     => 'require|max:11',
        'nationality|国籍'     => 'require|max:10',
        'card_type|身份证类型'     => 'require|max:3',
        'card_expiration|证件有效期 Y-m-d'     => 'require|max:11',
        'email|邮箱'     => 'max:50',
        'country_code|发证国家'     => 'require|max:10',
        'office_no|工作号'     => 'require|length:6',
        'flight_no|航班号'     => 'require|min:3|max:6',
        'sales_id|销售id'     => 'require',
        'patron_id|客户号'     => 'require|max:20',
        'fly_day|起飞日期'     => 'require|length:10',
        'fly_time|起飞时间'     => 'require|length:5',
        'sales_price|销售价'     => 'require',
        'sales_type|销售类型'     => 'require|length:1',
    ];

    protected $scene = [
        'merge2redis' => ['key'],
        'passenger' => ['name', 'second_name', 'id_card', 'birthday', 'nationality', 'card_type', 'card_expiration', 'country_code'],
        'flight' => ['sales_type','office_no', 'flight_no', 'fly_day', 'fly_time', 'sales_price'],
        'update' => ['id','city', 'city_name', 'province'],
    ];

}